using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using PhotoHsn.BLL.Abstracts;
using PhotoHsn.BLL.Adapters;
using PhotoHsn.BLL.Core;

namespace PhotoHsn.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class Friends : ColumnInfo
    {
        public Friends()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Guid);
            this.TableName = "Friends";
        }

        #region Fields
		private Guid id = System.Guid.Empty;
		private Guid myMemberId = System.Guid.Empty;
		private Guid friendMemberId = System.Guid.Empty;
		private Int16 friendTypeId = -1;
		private DateTime createDate = new DateTime();
		private DateTime modifiedDate = new DateTime();
		private bool isActive = false;
		private bool isDeleted = false;

        #endregion
        
        #region Properties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("Id",true,"Guid")]
		public Guid Id
		{
			 get 
			 {
			    return id;
			 }
			 set 
			 { 
			    if (value != id)
			    { 
			      id = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.Id))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.Id, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("MyMemberId",true,"Guid")]
		public Guid MyMemberId
		{
			 get 
			 {
			    return myMemberId;
			 }
			 set 
			 { 
			    if (value != myMemberId)
			    { 
			      myMemberId = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.MyMemberId))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.MyMemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("FriendMemberId",true,"Guid")]
		public Guid FriendMemberId
		{
			 get 
			 {
			    return friendMemberId;
			 }
			 set 
			 { 
			    if (value != friendMemberId)
			    { 
			      friendMemberId = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.FriendMemberId))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.FriendMemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = smallint
		///C# Type = Int16
		///</summary> 
		[ColumnAttributes("FriendTypeId",true,"Int16")]
		public Int16 FriendTypeId
		{
			 get 
			 {
			    return friendTypeId;
			 }
			 set 
			 { 
			    if (value != friendTypeId)
			    { 
			      friendTypeId = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.FriendTypeId))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.FriendTypeId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("CreateDate",true,"DateTime")]
		public DateTime CreateDate
		{
			 get 
			 {
			    return createDate;
			 }
			 set 
			 { 
			    if (value != createDate)
			    { 
			      createDate = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.CreateDate))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.CreateDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("ModifiedDate",true,"DateTime")]
		public DateTime ModifiedDate
		{
			 get 
			 {
			    return modifiedDate;
			 }
			 set 
			 { 
			    if (value != modifiedDate)
			    { 
			      modifiedDate = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.ModifiedDate))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.ModifiedDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsActive",true,"bool")]
		public bool IsActive
		{
			 get 
			 {
			    return isActive;
			 }
			 set 
			 { 
			    if (value != isActive)
			    { 
			      isActive = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.IsActive))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.IsActive, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsDeleted",true,"bool")]
		public bool IsDeleted
		{
			 get 
			 {
			    return isDeleted;
			 }
			 set 
			 { 
			    if (value != isDeleted)
			    { 
			      isDeleted = value; 
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.IsDeleted))
			      IsUpdateOrInsert.Add(Friends.ColumnNames.IsDeleted, true); 
			      this.IsDirty = true; 
			    }
			 }
		}

        #endregion
		        
        #region StringProperties
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_Id
		{
			 get 
			 {
			        return Getuniqueidentifier_s(id);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref id);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.Id))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.Id, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_MyMemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(myMemberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref myMemberId);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.MyMemberId))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.MyMemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_FriendMemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(friendMemberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref friendMemberId);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.FriendMemberId))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.FriendMemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = Int16
		///C# Type = Int16
		///</summary> 
		public virtual string s_FriendTypeId
		{
			 get 
			 {
			        return Getsmallint_s(friendTypeId);
			 }
			 set 
			 { 
			        Setsmallint_s(value, ref friendTypeId);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.FriendTypeId))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.FriendTypeId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = DateTime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_CreateDate
		{
			 get 
			 {
			        return Getdatetime_s(createDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref createDate);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.CreateDate))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.CreateDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = DateTime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_ModifiedDate
		{
			 get 
			 {
			        return Getdatetime_s(modifiedDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref modifiedDate);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.ModifiedDate))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.ModifiedDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsActive
		{
			 get 
			 {
			        return Getbit_s(isActive);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isActive);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.IsActive))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.IsActive, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsDeleted
		{
			 get 
			 {
			        return Getbit_s(isDeleted);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isDeleted);
			      if (!IsUpdateOrInsert.ContainsKey(Friends.ColumnNames.IsDeleted))
			        IsUpdateOrInsert.Add(Friends.ColumnNames.IsDeleted, true);
			        this.IsDirty = true;
			 }
		}

        #endregion

		#region ColumnNames
        public class ColumnNames
        {
		public const string Id = "Id";
		public const string MyMemberId = "MyMemberId";
		public const string FriendMemberId = "FriendMemberId";
		public const string FriendTypeId = "FriendTypeId";
		public const string CreateDate = "CreateDate";
		public const string ModifiedDate = "ModifiedDate";
		public const string IsActive = "IsActive";
		public const string IsDeleted = "IsDeleted";

        }
        #endregion
    }
}

namespace PhotoHsn.BLL.Abstracts
{
    public class _FriendsBs : BaseBs
    {
		public Boolean insert(Friends p) { return this._insert<Friends>(p); }
        public Boolean update(Friends p) { return this._update<Friends>(p); }
        public Boolean delete(Friends p) { return this._delete<Friends>(p); }
        public List<Friends> get(string sql) { return this._get<Friends>(sql); }
        public List<Friends> get(System.Data.SqlClient.SqlCommand sqlcommand) { return this._get<Friends>(sqlcommand); }
		public List<Friends> get_all(List<string> columnNames) { return this._get_all<Friends>(columnNames); }
        public List<Friends> get_all_with_all_columns() { return this._get_all_with_all_columns<Friends>(); }
		public Friends get_by_primarykey(System.Guid pk, List<string> columnNames) { return this._get_by_primarykey<Friends>(pk, columnNames); }
    }
}
